package org.japo.java.gui.samples;

import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import javax.swing.JOptionPane;

class GET extends KeyAdapter {

    private IGU igu;

    GET(IGU igu) {
        this.igu = igu;
    }

    @Override
    public void keyPressed(KeyEvent ke) {
        int teclaPulsada = ke.getKeyCode();
        if (teclaPulsada == KeyEvent.VK_ENTER) {
            Object o = ke.getSource();
            if (o.equals(igu.btnAceptar)) {
                igu.procesarIdentificacion();
            } else {
                JOptionPane.showMessageDialog(igu, "Proceso CANCELADO");
                igu.txfUser.setText("");
                igu.psfPass.setText("");
                igu.txfUser.requestFocus();
            }
        }
    }
}
